//
//  ShakeTap.swift
//  loveHHEveryDay
//
//  Created by yw on 2025/4/8.
//

import SwiftUI

struct ShakeTap: ViewModifier {
    var myCustomTapHandler: () -> Void
    func body(content: Content) -> some View {
        content.onTapGesture {
            let generator = UIImpactFeedbackGenerator(style: .light)
            generator.prepare()
            generator.impactOccurred()
            myCustomTapHandler()
        }
    }
}


extension View {
    func shakeTapGes(handler:@escaping () -> Void) ->some View {
        modifier(ShakeTap(myCustomTapHandler: handler))
    }
}
